package com.lywz.biz.dao.food.impl;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.lywz.biz.common.dao.AbstractBaseDao;
import com.lywz.biz.common.entity.goodfood.Restaurant;
import com.lywz.biz.dao.food.RestaurantDao;
import com.lywz.core.util.CommonDefaultCheck;

@Repository("restaurantDao")
public class RestaurantDaoImpl extends AbstractBaseDao implements RestaurantDao {

    @SuppressWarnings("unchecked")
    @Override
    public List<Restaurant> getRestaurantListByClassicFoodId(int classicFoodId) throws Exception {
        Query query = session().getNamedQuery("restaurant.getListByClassicFoodId");
        query.setParameter("classicFoodId", classicFoodId);
        return (List<Restaurant>) CommonDefaultCheck.checkDefault(query.list());
    }

}
